import request from '@/utils/request'

export function getDepartmentList() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

export function addNewDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

export function editDetailById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}

export function putDetailById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

// /company/department/{id}
export function deleteDepartById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}
